//
//  bendipicTableViewCell.m
//  hainingOASystem
//
//  Created by michael on 2017/11/17.
//  Copyright © 2017年 czd. All rights reserved.
//

#import "bendipicTableViewCell.h"

@implementation bendipicTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.bgView  = [[UIView alloc]init];
       [self.contentView addSubview:_bgView];

 _label1 = [[UILabel alloc]init];
    _label1.frame = CGRectZero;
    
      [_label1 setFont:[UIFont systemFontOfSize:13]];
                _label1.numberOfLines = 0;

       [self.bgView addSubview:_label1];
    
       _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
    _label2.numberOfLines = 0;
      [_label2 setFont:[UIFont systemFontOfSize:12]];
       [self.bgView addSubview:_label2];
    
       _label3 = [[UILabel alloc]init];
    _label3.frame = CGRectZero;
      [_label3 setFont:[UIFont systemFontOfSize:12]];
       [self.bgView addSubview:_label3];
    
_image = [[UIImageView alloc]init];
_image.frame = CGRectZero;
       [self.bgView addSubview:_image];

}

return self;

}
- (void)layoutSubviews{
[super layoutSubviews];
// 80+10+10+20= 100
  self.bgView.backgroundColor = [UIColor whiteColor];
    //给bgView边框设置阴影
    self.bgView.layer.shadowOffset = CGSizeMake(1,1);
    self.bgView.layer.shadowOpacity = 0.3;
    self.bgView.layer.shadowColor = [UIColor blackColor].CGColor;
        self.bgView.layer.cornerRadius = 5;
  self.bgView.frame =  CGRectMake(5, 5, KScreenWidth - 10, 130);

_image.frame  = CGRectMake(KScreenWidth-100-20, 10, 100, 100);
NSString *url = [NSString stringWithFormat:@"%@%@",kip,_dic[@"defaultPicUrl"]];
    [self.image sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"加载"]];
_label1.frame =CGRectMake(10, 10, KScreenWidth-_image.width-30, 40);
_label1.textColor = [UIColor blackColor];//其中textColor要用UIColor类型
_label1.text = [NSString stringWithFormat:@"%@",_dic[@"title"]];

_label2.frame =CGRectMake(10, _label1.bottom,KScreenWidth-100-20-10,40);
_label2.textColor = [UIColor blackColor];//其中textColor要用UIColor类型
//_label2.text = [NSString stringWithFormat:@"%@",_dic[@"Intro"]];
_label2.text = _dic[@"Intro"];

_label3.frame =CGRectMake(10, _label2.bottom,KScreenWidth-100-20-10, 20);
_label3.textColor = [UIColor grayColor];//其中textColor要用UIColor类型
_label3.textAlignment = NSTextAlignmentLeft;
_label3.text = [NSString stringWithFormat:@"%@",_dic[@"updateTime"]];

}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
